pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

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

K
kmo
Thu, Jun 17, 2021 11:45 AM

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

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
EL
Esteban Lorenzano
Thu, Jun 17, 2021 11:47 AM

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 voxkmp@gmail.com 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

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 <voxkmp@gmail.com> 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 >
K
kmo
Thu, Jun 17, 2021 12:47 PM

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

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
EL
Esteban Lorenzano
Thu, Jun 17, 2021 1:07 PM

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 voxkmp@gmail.com 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

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 <voxkmp@gmail.com> 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 >
K
kmo
Thu, Jun 17, 2021 2:18 PM

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

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