Spec Gtk Applications - Implementing File open/save/(print?) dialogs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
kmo
Reply | Threaded
Open this post in threaded view
|

Spec Gtk Applications - Implementing File open/save/(print?) dialogs

kmo
Hi -

When writing a Gtk app using Pharo Spec2 are there any facilities for
standard system dialogs - open file / save file / etc - or do you have to
create them from scratch yourself (perhaps using SpDialogPresenter) ?

Thanks in advance for any clarification.

Ken



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Reply | Threaded
Open this post in threaded view
|

Re: Spec Gtk Applications - Implementing File open/save/(print?) dialogs

Esteban Lorenzano
Hello,

if you want to play with the direct Gtk dialog, you have GtkFileChooserDialog... take a look at it :)

Esteban

On Jun 17 2021, at 1:45 pm, kmo <[hidden email]> wrote:
Hi -

When writing a Gtk app using Pharo Spec2 are there any facilities for
standard system dialogs - open file / save file / etc - or do you have to
create them from scratch yourself (perhaps using SpDialogPresenter) ?

Thanks in advance for any clarification.

Ken



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
kmo
Reply | Threaded
Open this post in threaded view
|

Re: Spec Gtk Applications - Implementing File open/save/(print?) dialogs

kmo
Thanks Esteban. That's what I needed. I've got the dialog to open, like this
-

generateRoseButton action: [
                (GtkFileChooserDialog newOpenFileTitle: 'Hello')
                        showAll;
                        run ]


But how do you get the chosen filename back?

Ken

 



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Reply | Threaded
Open this post in threaded view
|

Re: Spec Gtk Applications - Implementing File open/save/(print?) dialogs

Esteban Lorenzano
lol, I just realised I forgot to push my changes to it (I am working on fixing a leak on dialogs, so probably you will need to pull again soon, btw :P)
anyway, you can pull gtk-bindings now and you will have the right accessors.

Also, I have been working on a wrapper to  help with the Gtk details (the idea is to integrate something to the newtools, so I need something that eventually can be mapped to a morphic component too ;) )
You can file in the exports I sending you (check the right order ;) )

And you should be able to execute what is in NmFileChooserDialog class>>example to get something like this:


I think this can point you in the right direction.
BUT! This is very early work... do not expect something ready for production :)

Esteban

On Jun 17 2021, at 2:47 pm, kmo <[hidden email]> wrote:
Thanks Esteban. That's what I needed. I've got the dialog to open, like this
-

generateRoseButton action: [
(GtkFileChooserDialog newOpenFileTitle: 'Hello')
showAll;
run ]


But how do you get the chosen filename back?

Ken





--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

NmFileChooserDialog.st (8K) Download Attachment
NmFileChooserResult.st (1K) Download Attachment
NmFileChooserChoice.st (1K) Download Attachment
NmFileChooserBooleanChoice.st (1K) Download Attachment
NmFileChooserOptionsChoice.st (1K) Download Attachment
kmo
Reply | Threaded
Open this post in threaded view
|

Re: Spec Gtk Applications - Implementing File open/save/(print?) dialogs

kmo
Wow! Thanks so much Esteban for taking all the time and trouble to provide
this. I'll have a play with it.

Ken



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html